import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {path: '/',redirect:'/login'},
    {path: '/manager',component: () => import('../views/Manager.vue'),
    children:[
      {path:'home', name:'home', component:() => import('../views/Home.vue'),},
      {path:'vm', name:'vm', component:() => import('../views/VM.vue'),},
      {path:'charts', name:'charts', component:() => import('../views/Charts.vue'),},
      {path:'user', name:'user', component:() => import('../views/User.vue'),},
      {path: 'person',name:'person',component: () => import('@/views/PersonInfo.vue')},
      {path: 'updatePassword',name:'updatePassword',component: () => import('@/views/UpdatePassword.vue')}
    ]},
    {path:'/notfound', name:'404', component: import('../views/404.vue'),},
    {path: '/login', name:'login',component: () => import('@/views/Login.vue')},
    {path: '/register', name:'register',component: () => import('@/views/Register.vue')},
    {path:'/:pathMatch(.*)', redirect:'/notfound'}
  ],
})

export default router
